Skip to content

Add Electroscope: live microscope viewer with an MCP server for Claude - #1

Merged
rafiki270 merged 1 commit into
mainfrom
feat/initial-app
Oct 31, 2026
Merged

rafiki270 merged 1 commit into
mainfrom
feat/initial-app

Conversation

@rafiki270

Copy link
Copy Markdown
Contributor

Summary

First version of Electroscope: a native-looking desktop app that shows a microscope camera live and lets Claude take still frames over MCP, so you and Claude can look at the same board without fighting over one camera stream.

  • App: Electron, Windows 11 look (Mica, native title bar overlay). Same code builds for macOS (config in package.json, not run on a Mac).
  • Live view: wheel-zoom, drag-pan, grid and crosshair, freeze, rotate and mirror, live sharpness meter, camera list, hardware controls when the camera has them.
  • MCP server (src/main/mcp): Streamable HTTP on 127.0.0.1:47821. Tools: get_status, list_cameras, capture_snapshot, capture_sequence, select_camera, set_camera_controls, set_orientation, get_shared_frames. Snapshots can crop a full-resolution region or follow the area you have zoomed to, and return focus, brightness and exposure metrics with plain-language hints.
  • You stay in control: access switch, a strip of every frame Claude took, a flash on capture, and "Share with Claude" to pin a frame with a note.
  • Safety: loopback only, 403 on foreign Host or Origin, sandboxed renderer with a strict CSP.
  • Cheap UVC cameras: controls the camera accepts but does not apply are detected and reported as responsive: false. The microscope used for testing does this for brightness, contrast and saturation.
  • Icon, docs, CI: icon rendered from build/icon.svg; README.md, docs/mcp.md; Windows CI runs typecheck, unit tests and the end-to-end script with a synthetic camera.

Testing

Ran:

  • npm run typecheck, npm test (22 unit tests: tools, transport safety, settings, bridge).
  • node scripts/e2e.mjs against a real UVC microscope camera (GENERAL - UVC, 1280x720): 16/16 checks over MCP using the official SDK client, from both the source tree and the packaged Electroscope.exe.
  • node scripts/e2e.mjs --fake (synthetic camera): 16/16.
  • npm run dist (unpacked Windows build); npm audit --omit=dev: 0 vulnerabilities.

Not run:

  • macOS build and camera permission flow.
  • Installer targets (dist:installer) and code signing; builds are unsigned.
  • A real Claude Code session against the server; the test client is the MCP SDK's Streamable HTTP client.
  • Camera hot-unplug and replug.

🤖 Generated with Claude Code

The app owns the camera and shows the live view, so a human and Claude can
look at the same microscope without competing for a single camera stream.
Claude gets still frames on demand over a local MCP server.

- Electron app with a Windows 11 look (Mica, native title bar overlay); the
  same code builds for macOS
- Live view with zoom/pan, grid and crosshair, freeze, rotate/mirror and a
  live sharpness meter; hardware controls shown when the camera supports them
- MCP over Streamable HTTP on 127.0.0.1: get_status, list_cameras,
  capture_snapshot (full-resolution regions, follow the human's zoomed view),
  capture_sequence, select_camera, set_camera_controls, set_orientation,
  get_shared_frames
- Human stays in control: access switch, a strip of every frame Claude took,
  Share with Claude with a note, Host/Origin checks against DNS rebinding
- Controls the camera accepts but does not apply are detected and reported
- Unit tests for the MCP layer and an end-to-end script that drives the real
  app over MCP with a real or synthetic camera; Windows CI runs the latter

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T15:46:50.997972Z
We couldn’t complete this review. Comment @codex review to try again.
ce97c74 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@rafiki270
rafiki270 merged commit ce97c74 into main Oct 31, 2026
1 check passed
@rafiki270
rafiki270 deleted the feat/initial-app branch October 31, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant